package FlyGame;

import javax.swing.*;
import java.awt.*;

public class OverPanel extends JPanel {

    public int score;
    JButton home;
    JButton reGame;

    public OverPanel() {
        home =new JButton(FlyPicture.Home);
        reGame =new JButton(FlyPicture.ReStart);
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        setLayout(null);
        FlyPicture.OverBack.paintIcon(this,g,0,0);

        home.setOpaque(false);
        home.setBorder(null);
        home.setContentAreaFilled(false);

        reGame.setOpaque(false);
        reGame.setBorder(null);
        reGame.setContentAreaFilled(false);

        this.add(home);
        this.add(reGame);

        home.setBounds(20,180,70,70);
        reGame.setBounds(120,180,70,70);
        //书写分数
        g.setColor(Color.white);
        g.setFont(new Font("微软雅黑", Font.BOLD, 40));
        g.drawString(String.valueOf(this.score), 85, 60);

    }


}
